<script language="javascript">
	function funSearchTinhThanh(id,cid){
		window.location = '<?=$root?>/?mod=timkiem&cid=' + cid + '&ttid=' + id;
	}
	function funFormSearchTheoGia(cid){
		var a = document.getElementById('txtFrom');
		var b = document.getElementById('txtTo');
		var t1 = false;
		var t2 = false;
		var t3 = false;
		var t4 = false;
		if(a.value == ""){alert('Không được để trống !'); a.focus(); return false;}else{
			t1 = true;
		}
		
		if(isNaN(a.value)){alert('Chỉ nhật số !'); a.focus(); a.value = ''; return false;}else{
			t2 = true;
		}
		
		if(b.value == ""){alert('Không được để trống !'); b.focus(); return false;}else{
			t3 = true;
		}
		
		if(isNaN(b.value)){alert('Chỉ nhật số !'); b.focus(); b.value = ''; return false;}else{
			t4 = true;
		}
		
		if( (t1 == true) && (t2 == true) && (t3 == true) && (t4 == true) ){
			window.location='<?=$root?>/?mod=timkiem&cid=' + cid + '&act=theogia&fgid=' + a.value + '&tgid=' + b.value;
		}
		
	}
</script>
<div id="filterbox">

    <div class="panel-top-right">
        <div class="panel-top-left">
            <div class="panel-top-bg"></div>
        </div>
    </div>
    <div class="panel-body">                    
         <p class="panel-header">            
             Tìm theo điều kiện            
        </p>        
        <div class="panel-sep"></div>
        <div class="panel-content">       
            <div class="header"><span>Phạm vi bán</span></div>

            <div class="body">
                <ul>
                    <li><span><a href="<?=$root?>/t-tim-kiem/tinh-thanh/1">Toàn quốc</a></span></li><li><span><a href="<?=$root?>/t-tim-kiem/tinh-thanh/4">TP. Hồ Chí Minh</a></span></li><li><span><a href="<?=$root?>/t-tim-kiem/tinh-thanh/3">Hà Nội</a></span></li>                                                     
                    <li>
                        <select name="tinhthanh" id="tinhthanh" style="width:210px;" onchange="funSearchTinhThanh(this.value,'<?=$cid?>')">
							<option value="-1">Các tỉnh thành khác</option>
							<?
								$rs = $db->query("SELECT * FROM ".$prefix."tinhthanh WHERE tt_maquocgia = 1 AND tt_id NOT IN(1,3,4) ORDER BY tt_ten ASC");
								while($row = $db->fetch_array($rs)){
								$tt_ten = stripslashes($row[tt_ten]);
								$tt_id = $row[tt_id];
							?>
							<option value="<?=$tt_id?>"><?=$tt_ten?></option>
							<? } ?>
						</select>
                    </li>
                </ul>

            </div>  
            
                    
                
                    <div id="filterContent_Box0" class="filterContentHolder" style="display: block;">                                
                        <div class="header">
						<span>Giá bán</span>
						</div>
						<div class="body">
						<ul><li>
						<span><a href="<?=$root?>/g-tim-kiem/theo-gia/0-50000">Dưới 50.000 VNĐ</a></span>
						</li>
						<li>
						<span><a href="<?=$root?>/g-tim-kiem/theo-gia/50000-500000">50.000 - 500.000 VNĐ</a></span>
						</li>
						<li>
						
						<span><a href="<?=$root?>/g-tim-kiem/theo-gia/500-5000000">500.000 - 5 Triệu VNĐ</a></span>
						</li>
						<li>
						<span><a href="<?=$root?>/g-tim-kiem/theo-gia/5000000-15000000">5 Triệu - 15 Triệu VNĐ</a></span>
						</li>
						<li>
						<span><a href="<?=$root?>/g-tim-kiem/theo-gia/15000000-0">Trên 15 Triệu VNĐ</a></span>
						</li>
						</ul><p><span style='font-size: 10px; padding-right: 13px; padding-left: 10px;'>Từ:</span>

						<span>
						<input id="txtFrom" name="txtFrom" type="text" maxlength="15" value="" style="width: 100px; border: solid 1px #CCC; background-color: #FFFDDD;">
						</span>
						<span style='font-size: 10px;'>&nbsp; VNĐ</span><br />
						<span style='font-size: 10px; padding-right: 5px; padding-left: 10px;'>Đến:</span>
						<span><input id="txtTo" name="txtTo" type="text" maxlength="15" value="" style="width: 100px; border: solid 1px #CCC; background-color: #FFFDDD;"></span>
						<span style='font-size: 10px;'>&nbsp; VNĐ</span><br />
						<span style='padding-left: 45px;'><img alt="Tìm" src="<?=$root?>/themes/images/tim.jpg" align="absbottom" style='cursor: pointer;margin-top:2px;' onclick="javascript: funFormSearchTheoGia('<?=$cid?>');"/></span>
</p></div>
</div>        
 </div> 
        <br style="line-height:1px;font-size:0px;clear:both;" />
    </div>
    <div class="panel-bottom-right">
        <div class="panel-bottom-left">
            <div class="panel-bottom-bg"></div>
        </div>
    </div>
</div>